import com.google.inject.Inject;

import java.util.Set;

public class AuthenticatorsProvider implements IAuthenticatorsProvider
{
    Set<IAuthenticator> authenticators;

    @Inject
    public AuthenticatorsProvider(Set<IAuthenticator> authenticators)
    {
        this.authenticators = authenticators;
    }

    public IAuthenticator getAuthenticator(String authenticatorName)
    {
        for(IAuthenticator authenticator : authenticators)
            if(authenticator.getName().equals(authenticatorName))
                return authenticator;
        return null;
    }
}
